
package tomcat;
import java.io.IOException;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @Title:
 *         <P>
 *         TomcatServlet.java
 *         </P>
 * @Package
 *          <P>
 *          com.xs.tomcat
 *          </P>
 * @Description:
 *               <P>
 *               TODO该类...
 *               </P>
 * @author renweiping
 * @date 2019年1月10日 下午12:50:23
 * @version 1.0
 */
@WebServlet(urlPatterns="/demo")
public class TomcatServlet extends HttpServlet {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/* (non-Javadoc)
	 * @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
	 */
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		req.setCharacterEncoding("UTF-8");
		resp.setContentType("text/html;charSet=utf-8");
		resp.setCharacterEncoding("UTF-8");
		String msg = req.getParameter("msg");
		resp.getWriter().write("you say:"+msg);
	}
}
